package ru.disa.blog.post;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import ru.disa.blog.comment.Comment;

public class Post {
	private PostId postId;
	private String text;
	private Date date;
	private List<Comment> comments;
	
	public Post(String text) {
		this.text = text;
		this.date = new Date();
		this.comments = new ArrayList<Comment>();		
	}
	
	public Comment comment(String text) {
		Comment comment = new Comment(text);
		this.comments.add(comment);
		return comment;
	}
	
	public PostId getPostId() {
		return postId;
	}
	public void setPostId(PostId postId) {
		this.postId = postId;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public List<Comment> getComments() {
		return comments;
	}
	public void setComments(List<Comment> comments) {
		this.comments = comments;
	}	
}
